<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>131正则练习</title>
		<!-- 
			提取出下面字符中手机号
			dajsdh13715678903jasdlakdkjg13457890657djashdjka13811678908sdadadasd
			用自己的语言来把描述出来
			1       3          501789087
			1    3到9之间      任意数字x9
		 -->
		<script>
			let str = "dajsdh13715678903jasdlakdkjg13457890657djashdjka13811678908sdadadas1382116789083d";
			//let re = /[0-9]{11}/g
			//这个有缺陷，如果12位的错误手机号也会被匹配取出来。
			//应该在结尾想办法让11位的后面必须是非数字，/1[3-9]\d{9}(?=\D|$)/g
			let re = /1[3-9]\d{9}/g
			re = /(1[3-9]\d)\d{4}(\d{4})/g
			while ((result = re.exec(str))) {
				console.log(result[1] + "****" + result[2]); //137****8903
			}
		</script>
	</head>
	<body>
	</body>
</html>